﻿using System;
using System.Collections.Generic;

namespace Dapper.Common
{
    /// <summary>
    /// 分页数据返回
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [Serializable]
    public class PagedResultOutput<T>
    {
        public int total { get; set; }

        private IList<T> _rows;

        public IList<T> rows
        {
            get { return _rows ?? (_rows = new List<T>()); }
            set { _rows = value; }
        }

        public PagedResultOutput()
        {
        }

        public PagedResultOutput(int totalCount, IList<T> items)
        {
            total = totalCount;
            rows = items;
        }
    }
}